package cn.dkk.structure_design.decorator;

import cn.dkk.structure_design.decorator.pojo.FastFood;

/**
 * @author dkk
 * @date 2022/7/10
 * @desc
 */
public class Egg extends Decorator{


    public Egg(FastFood fastFood) {
        super("鸡蛋", 1, fastFood);
    }

    @Override
    public double cost() {
        return getFastFood().cost()+getPrice();
    }

    @Override
    public String toString(){
        return getFastFood().getDesc()+getDesc();
    }

    @Override
    public String getDesc() {
        return super.getDesc()+getFastFood().getDesc();
    }
}
